package com.gljx.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.Department;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.DepartmentMapper;
import com.gljx.web.service.DepartmentService;

@Service
@Transactional
public class DepartmentServiceImpl extends CommonDao implements DepartmentService{

	//自动注入
	@Autowired
	private DepartmentMapper departmentMapper;
	
	/**
	 * 根据控制单元id查询部门方法
	 */
	@Override
	public List<Department> queryAdminByController(String comppanyId) {
		// TODO Auto-generated method stub
		return departmentMapper.selectAdminByController(comppanyId);
	}

	/**
	 * 根据fid查询部门
	 */
	@Override
	public Department queryAdminByFid(String fid) {
		// TODO Auto-generated method stub
		return departmentMapper.selectAdminByFid(fid);
	}

    //全部组织
    @Override
    public List<Department> selectAdminList(String name) {
        return departmentMapper.selectAdmin(name);
    }

    @Override
    public List<Department> selectAdminListAsfcontid(String name, String fcontrolunitid) {
        return departmentMapper.selectAdminAsfcontid(name, fcontrolunitid);
    }


}
